package com.info.zhiduoduo.pay.controller;

import com.info.zhiduoduo.common.constants.SmartResult;
import com.info.zhiduoduo.common.formbean.BaseSimpleFormBean;
import com.info.zhiduoduo.pay.formbean.kltongpay.MerchantFormBean;
import com.info.zhiduoduo.pay.sdk.kltongpaysdk.model.balance_change.BalanceChangeNofity;
import com.info.zhiduoduo.pay.service.MerchantService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/merchant")
public class MerchantController {

	@Autowired
	MerchantService merchantService;

	@PostMapping("/add")
	public SmartResult addMerchant(@RequestBody BaseSimpleFormBean<MerchantFormBean> formBean) {
		return merchantService.addMerchant(formBean);
	}

	@PostMapping("/queryState")
	public SmartResult queryMerchant(@RequestBody BaseSimpleFormBean<String> formBean) {
		return merchantService.queryMerchant(formBean);
	}

	@PostMapping("/accountInfo")
	public SmartResult queryAccountInfo(@RequestBody BaseSimpleFormBean<Integer> formBean) {
		return merchantService.queryAccountInfo(formBean);
	}

	@PostMapping("/balanceNotify")
	public String balanceChangeNotify(BalanceChangeNofity nofityResult) {
		return merchantService.balanceChangeNotify(nofityResult);
	}
}
